package com.parking.stall.inter;

import com.parking.common.core.model.Result;
import com.parking.stall.client.dto.*;
import com.parking.stall.client.form.SelectDistanceCertifiedInfoForm;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Set;

/**
 * RentersClient:物业模块服务调用类
 */
@FeignClient(name = "parking-certified",path = "/certified")
public interface CertifiedClient {

    /**
     * 车位模块的调用
     * @param certifiedAccountId:物业账号id
     * selectCertifiedInfo:物业信息查询
     * @return SelectCertifiedInfoDTO:物业信息查询返回对象
     */
    @GetMapping("/certifiedInfo/selectCertifiedInfo/{certifiedAccountId}")
    public Result<SelectCertifiedInfoDTO> selectCertifiedInfo (@PathVariable("certifiedAccountId") Integer certifiedAccountId)throws Exception;

    /**
     * distanceCertifiedCall：获取距离范围内的所有物业信息
     * （车位模块调用）
     * @param form 查询距离范围内的所有物业信息参数
     * @return Set<DistanceCertifiedInfoDto>:距离范围内的物业信息对象
     */
    @PostMapping("/certifiedInfo/distanceCertifiedCall")
    @ApiOperation("获取距离范围内的所有物业信息（车位模块调用）")
    public Result <Set<DistanceCertifiedInfoDto>> distanceCertifiedCall(@RequestBody SelectDistanceCertifiedInfoForm form );

    /**
     * certifiedAccountCall：查询物业账号（车位模块调用）
     * @param certifiedAccountId:物业账号id
     * @return SelectCertifiedAccountIdDTO：物业账号信息参数对象
     */
    @GetMapping("/certifiedAccount/certifiedAccountCall")
    @ApiOperation("查询物业账号（车位模块调用）")
    public Result<SelectCertifiedAccountIdDTO> certifiedAccountCall(@RequestParam("certifiedAccountId") Integer certifiedAccountId);

    /**
     * （车位模块调用）
     * certifiedInfoAndStateServerCall:查询物业信息及物业账号状态
     * @param certifiedInfoId ：物业信息id
     * @return  SelectCertifiedInfoAndStateDTO： 物业信息及物业账号状态 对象
     */
    @GetMapping("/certifiedInfo/certifiedInfoAndStateServerCall")
    Result<SelectCertifiedInfoAndStateDTO> certifiedInfoAndStateServerCall(@RequestParam("certifiedInfoId")Integer certifiedInfoId);

    /**
     * selectCertifiedInfoByIds:根据物业信息ids获取物业信息集合
     * @param certifiedInfoIds
     * @return
     */
    @PostMapping("/certifiedInfo/selectCertifiedInfoByIds")
    Result<Set<CertifiedInfoByIdsDTO>> selectCertifiedInfoByIds(@RequestBody Set<Integer> certifiedInfoIds);
}
